package com.kpx.app.activity;

import java.io.File;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.MediaController;
import android.widget.VideoView;

import com.kpx.app.R;
import com.kpx.app.base.ActivityBase;
import com.kpx.app.view.TitleView;

/**
 * 视频播放.
 * 
 * @Description
 * @author paladin
 * @date 2013-8-12
 * @Copyright: Copyright (c) 2013 Shenzhen Tentinet Technology Co., Ltd. Inc.
 *             All rights reserved.
 */
public class PlayVideoActivity extends ActivityBase {

	/** 标题 */
	private TitleView view_title;
	/** 视屏播放控件 */
	private VideoView view_video;

	@Override
	public void initview(@Nullable Bundle savedInstanceState) {
		setContentView(R.layout.activity_play_video);
		view_title = (TitleView) findViewById(R.id.view_title);
		view_title.setTitle("视频播放");
		view_video = (VideoView) this.findViewById(R.id.view_video);
	}

	@Override
	public void initData() {
		Uri uri = Uri.fromFile(new File(getIntent().getExtras().getString(getString(R.string.intent_key_vedio))));
		view_video.setMediaController(new MediaController(this));
		view_video.setVideoURI(uri);
		view_video.start();
		view_video.requestFocus();
	}

	@Override
	public void onReceiver(Context context, Intent intent) {

	}
}
